# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Star Brilliant <echo bTEzMjUzQGhvdG1haWwuY29tCg== | base64 -d>

pkgname=stdoutisatty
pkgver=1.0
pkgrel=1
pkgdesc="Make programs think their stdout is a tty / terminal."
arch=('loong64' 'x86_64')
url='https://github.com/lilydjwg/stdoutisatty'
license=('BSD')
depends=('glibc')
makedepends=('cmake')
source=("https://github.com/lilydjwg/stdoutisatty/archive/$pkgver/$pkgname-$pkgver.tar.gz")
b2sums=('e6beeb4a4b4695606ff64f9c219dcb5ce9629504f71897d6e9e914af4cb7dfd533d597a650b5bccc7ada6176f619b339d15d18a26f8050b0ff2ef8198282b750')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake -D CMAKE_INSTALL_PREFIX=/usr ../stdoutisatty-$pkgver
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
  install -Dm644 ../$pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
